<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>一、拖放</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
			<link rel="stylesheet" type="text/css" href="styles.css">
		-->
		<jsp:include page="../basic/easyui_loder.jsp" flush="true"/>
		<script type="text/javascript">
			$(document).ready(function(){
				$('#dd1').draggable();
				$('#dd2').draggable({
					proxy:'clone'
				});
				$('#dd3').draggable({
					proxy:function(source){
						var p = $('<div class="proxy">proxy</div>');
						p.appendTo('body');
						return p;
					}
				});
				/** 构建购物车型拖放 **/
				
				
				
				/** 课程 **/
				$('.left.item').draggable({
					revert:true,
					proxy:'clone'
				});

				$('.righttd.drop').droppable({
					onDragEnter:function(){
						$(this).addClass('over');
					},
					onDragLeave:function(){
						$(this).removeClass('over');
					},
					onDrop:function(e,source){
						$(this).removeClass('over');
						if($(source).hasClass('assigned')){
							$(this).append(source);
						}else{
							varc=$(source).clone().addClass('assigned');
							$(this).empty().append(c);
							c.draggable({
								revert:true
							});
						}
					}
				});
				
			});
			
		</script>
		<style type="text/css">
			div{width: 100px;height: 100px;}
		
		</style>
		

	</head>

	<body>
		<hr/>
		<h2>基本拖放</h2>
		<div id="dd1" class="dd-demo" style="background-color: gray;">11111</div>
		<div id="dd2" class="dd-demo" style="background-color: red;">22222</div>
		<div id="dd3" class="dd-demo" style="background-color: green;">33333</div>
		
		<hr/>
		<h2>构建购物车型拖放</h2>
		
		
		<hr/>
		<h2>创建课程表</h2>
		
		<div class="left">
			<table>
				<tr>
					<td>
						<div class="item">English</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="item">Science</div>
					</td>
				</tr>
				<!--othersubjects-->
			</table>
		</div>
		<div class="right">
			<table>
				<tr>
					<td class="blank"></td>
					<td class="title">Monday</td>
					<td class="title">Tuesday</td>
					<td class="title">Wednesday</td>
					<td class="title">Thursday</td>
					<td class="title">Friday</td>
				</tr>
				<tr>
					<td class="time">08:00</td>
					<td class="drop"></td>
					<td class="drop"></td>
					<td class="drop"></td>
					<td class="drop"></td>
					<td class="drop"></td>
				</tr>
				<!--othercells-->
			</table>
		</div>
		
	</body>
</html>
